﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TrainManage.aspx.cs" Inherits="news_mini_TrainManage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>会场培训后台管理列表</title>
<link href="../../css/style.css" rel="stylesheet" type="text/css" />
<script src="../../js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script type="text/javascript" defer="defer" src="../../My97DatePicker/WdatePicker.js"></script>
<base target="_self"/>
</head>
<body>
    <form id="form1" runat="server">
    <div class="button_bar">        
    <asp:Button ID="btnAdd" CssClass="common_button" runat="server" Text="添加" 
            onclick="btnAdd_Click"/>
         <%--<input type="button" id="add" name="add" value="添加" class="common_button" onclick="document.location='TrainDetail.aspx';return false;" />--%>
         <input type="button" id="search" name="search" value="查询" />
    </div>
    <table class="query_form_table">
        <tr>           
            <th align="right">
                标题：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </th>
            <td>
                <input type="text" id="titlekey" name="titlekey" maxlength="100" width="100px" />
            </td>
          
          <th align="right">
                开始日期：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </th>
            <td>
                <input id="datekey" name="datekey" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" type="text" />
            </td>

            <th align="right">
                结束日期：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </th>
            <td>
                <input id="enddatekey" name="enddatekey" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" type="text" />
            </td>
        </tr>
    </table>
    <table class="data_list_table" id="tablehovered">
        <%=tables %>       
    </table>
 <table>
  <tr>
	<td id="pages" class="tablerow2" align="right" colspan="4" id="NextPageText">
	<%=pages %>
   
	</td>
  </tr>
</table> 
    
    </form>

    <script type="text/javascript" language="javascript">

        function Get(pageindex, begin, end, title) {
            GetPageData(pageindex, begin, end, title);
            CountPage(pageindex, begin, end, title);
        }

        function GetPageData(pageindex, begin, end, title) {
           
            $.post("ManageHandler.ashx", { T: "getdata", page: pageindex, begin: begin, end: end, title: title, type: "ZXHC" }, function (data) {
                $("#tablehovered").html(data);
            });
            return false;
        }

        function CountPage(index, begin, end, title) {
            $.post("ManageHandler.ashx", { T: "page", page: index, begin: begin, end: end, title: title, type: "ZXHC" }, function (data) {
                $("#pages").html(data);
            });
            return false;
        }

        function del(id) {
            //alert(id);
            $.post("ManageHandler.ashx", { T: "del", trid: id }, function (data) {
                if (data == "1") {
                    alert("数据删除成功！");
                    window.location.reload();
                }
                else
                    alert("删除失败，请联系管理员！");
            });
        }

        $("#search").click(function () {
            var tkey = $("#titlekey").val();
            var dkey = $("#datekey").val();
            var edkey = $("#enddatekey").val();
            var type = $("#type").val();

            GetPageData(1, dkey, edkey, tkey);
            //页码信息
            CountPage(1, dkey, edkey, tkey);
        });
    </script>

</body>
</html>
